def get_baidu_token() -> str:
    """获得百度的token"""
    import requests
    ak = "DnLQkB1hbUcrXfwr5B71D0qr" # 第2步中的API Key
    sk = "HUKuqeMoqK4P8HkqUjjYsvIYVZGoVY79" # 第2步中的Secret Key
    # client_id 为官网获取的AK， client_secret 为官网获取的SK
    host = 'https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id={0}&client_secret={1}'.format(
        ak, sk)
    response = requests.get(host)
    if response:
        print(response.json()) # 这是返回的字段
        # print('token：', response.json()['refresh_token'])
        # print('有效期：', response.json()['expires_in'])
        return response.json()['access_token']

get_baidu_token()